Make analytics multi-backend, add native solution#1090
Make analytics multi-backend, add native solution#1090gmarull merged 8 commits intocoredevices:mainfrom
Conversation
fce9770 to
5290603
Compare
|
just updated eng-dash to match this format. @sjp4 can you add this to mobile pls? |
|
|
||
| PBL_ASSERTN(dls_initialized()); | ||
|
|
||
| s_dls_session = dls_create(DlsSystemTagAnalyticsDeviceHeartbeat, DATA_LOGGING_BYTE_ARRAY, |
There was a problem hiding this comment.
Should we use a different/new tag for this? The existing tag will be reporting from legacy firmwares with a different format, so maybe we should separate this format
The new mechanism should work as follows:
This makes sure the backend will always store new metrics without any changes, and that non-released builds will be ignored (no ELF match). |
181dc42 to
b7d7e25
Compare
b7d7e25 to
575d3d7
Compare
see mobile branch |
It should boot now, force pushed a few mins ago |
|
Plan is to have GitHub CI upload the elf? |
|
Problem is I don't want to have it auto add new columns in bigquery if we can help it...so we'll still need a manual step somewhere (the new data will be stored in the raw field so we don't lose it. ) |
We can enable fields we want, but we should process all we get and store it (same as memfault really). We could have a place where to select which detected metrics we want to track, give them a name, etc. It's a more robust approach IMHO, things are decoupled which is great. The blob also contains scaling factors. |
Yes, same as we do for Memfault |
it's all tracked in a raw field so we don't lose any data but we'll need to add column/to the metrics viewer - it won't do it automatically. I think we're saying the same things. |
That works as soon as old raw can be post processed when new column is added. I think Memfault just inserts columns automatically and adds data, so you can immediately plot/track whatever you want. But you can also archive a metric, and customize a few aspects of it. IMHO Memfault does the right thing here, it's just not great in their inspection capabilities (plots, stats, etc.)... |
|
ok it's merged and deployed to eng-dash, can you give me a sample file or something that I can test the ingester with? |
Just build this branch and take tintin_fw.elf |
Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
So we can use multiple backends at the same time. Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
ca7f672 to
dfe7d0d
Compare
Add the native analytics backend that logs heartbeat records via DLS. Metrics are stored in flat arrays indexed by key enum and serialized into a packed struct on each heartbeat. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
Instead of relying on Memfault. The new native solution keeps compatibility with Memfault, but one can also extract the same info using native metrics alone. Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
Add a pyelftools-based script that extracts the native_heartbeat_record struct layout from ELF DWARF debug info, printing field names, offsets, sizes, and types. Uses a fast binary search in .debug_str/.debug_info to locate the right CU, avoiding full DWARF parsing. Useful for building parsers for the analytics DLS blob. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
dfe7d0d to
2f91510
Compare
This transforms the analytics service into multi-backend capable. It also adds a native backend option that does not rely on third-party services. Compared to the old native implementation, here we should not rely on any fixed blob layout. Instead, the ELF file can be used to obtain the actual blob layout/fields/sizes, etc. (see the last commit with a tool that shows how to do that).
Needs some testing...!